'use strict';

const axios = require('axios')

// 注意baseUrl要带http协议
const BASE_URL = process.env.BASE_URL ? process.env.BASE_URL : 'http://gsh.cli:7001'

const request = axios.create({
  baseURL: BASE_URL,
  timeout: 5000
})

request.interceptors.response.use(
  res => res.data,
  err => {
    console.log(err)
    return Promise.reject(err)
  }
)

module.exports = request;

